<?php


$db = new PDO('mysql:host=localhost; dbname=db3', 'root', '12qwas');
$ps = $db->prepare('select * from students where age>=?'); //这里？就是一个占位符
$ps->execute([19]); //在执行查询时可以通过传递一个数组参数包含占位符对应的值
foreach ($ps as $r) { //遍历结果集中的每条记录
    echo "{$r['xh']}\t{$r['name']}\t{$r['age']}\n";
}